// ==UserScript==
// @name         自动登录
// @namespace    http://tampermonkey.net/
// @version      2024-06-08
// @description  try to take over the world!
// @author       You
// @match        https://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=aqinco.com
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  let data = [
    {
      url: 'https://aqinco.com/login',
      username: '18820651349',
      password: 'ios983@fsu-ksd',
      target: '[data-id="phone"]', // 有的时候，选择手机，邮箱等方式
      usernameInput: '#phoneInp',
      passwordInput: '#phonePwdInp',
      button: '#phone [type="submit"]',
    },
    {
      url: 'https://i.aqinco.com/',
      username: '18820651349',
      password: 'ios983@fsu-ksd',
      target: '', // 有的时候，选择手机，邮箱等方式
      usernameInput: '[type="email"]',
      passwordInput: '[type="password"]]',
      button: 'button',
    },
  ]

  data.forEach(item => {
    if (location.href.includes(item.url)) {
      try {
        if (item.target) document.querySelector(item.target).click();
        document.querySelector(item.usernameInput).value = item.username;
        document.querySelector(item.passwordInput).value = item.password;
        document.querySelector(item.button).click();
      } catch (error) { }
    }
  })

  // Your code here...
})();